package net.liuyimin.controller;

import net.liuyimin.service.StockService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class StockController {

    @Resource
    private StockService stockService;

    /**
     * 基于Zookeeper实现分布式锁
     */
    @GetMapping("stock/deductByZk")
    public String deduct(){
        this.stockService.deductByZk();
        return "hello stock deductByZk！！";
    }

}
